﻿using Microsoft.AspNetCore.Mvc;
using WCS_Entity.Dto;
using WCS_Entity.Dto.MasterDto;
using WCS_Service.DomianService.Interface;
using WCS_Service.Interface;

namespace WCS.Controllers
{
    /// <summary>
    /// 向上位服务开放的接口
    /// </summary>
    [ApiController]
    [Route("api/[controller]/[action]")]
    public class MasterController : ControllerBase
    {
        private readonly IMasterService _masterService;
        public MasterController(IMasterService masterService) 
        {
            _masterService = masterService;
        }
        /// <summary>
        /// 创建订单
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<WebApiCallBack> CreatOrder([FromBody] CreatOrderDto dto)
        {
            var result = new WebApiCallBack();
            await _masterService.CreatOrder(dto);
            return result;
        }
    }
}
